#include <string.h>
#include <iostream>
#include <vector>
#include "Triangulator.h"
#include "Triangle.h"
#include "Maze.h"
#include "Mazeprinter.h"
#include "PoissonDisks.h"
#include "Edge.h"
#include "Point.h"

void printUsage()
{
  cout << " This Function takes in input of" << endl;
  cout << "(Number of Points) (Distance between each Points) (Width of Maze) (Height of Maze)"<<endl;
  cout << "optional arguments:" <<endl;
  cout << "-p : print out Poisson Disk Distribution" << endl;
  exit(0);
}

int main (int argc, char * argv[]) {
    if (argc < 5)
    {
     printUsage();
    }

    int numberOfPoints = atoi(argv[1]);
    int distanceBetweenPoints = atoi(argv[2]);
    int width = atoi(argv[3]);
    int height = atoi (argv[4]);
    if (numberOfPoints == 0 || distanceBetweenPoints == 0 || width == 0|| height == 0){
        cout << "Please enter valid non-zero integers for the first four arguments"<<endl;
        printUsage();
    }

    Maze* mazer = new Maze(numberOfPoints, distanceBetweenPoints, width, height);

    bool printPoisson = false;
    if (argc == 6 && strcmp(argv[5], "-p")==0){
        printPoisson = true;
    }
    Mazeprinter* printa = new Mazeprinter(mazer, printPoisson);
    printa->print();
	return 0;

}
